package com.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000118648986";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQClzn4HsqGIFT3JmoOn/QZmAlSrulmfLYYjxZ14zDk55wKGkurDOM2BkNiaT1OiYsb/IxG4DCksAVPy9YO3MWklJNDdkMpm0LelLX7wN7/h9UgsBCyVwf9ABuUiM+9CC9wpHniteC04ME0eXCChcDma0KlTtmoZXRZZKOTK87OTExixFyKyiuE7i10v36HjCkLiTMU8Gt/nY2KLqoQAAEjldjNebNAqMg7qvHoKuEufMZKMfRXUnUBIhALPEj6pFiRs039rwQv9PD191SKNyFThntDlX91t6jJLYgrpxwpBfgar4JrEjzJ5Ms0R+fdeWmmeGBlEGucY7x52ZzAz8dpZAgMBAAECggEAK1frgj+kElrbKBSITiXKwmfhknLIcuAHrNo/7BAW9Zf6BQvq6tWygyhGNzB9gHmp45BbVW14ZdSDCYQ8xmrYPal+IC11e6McHsXh5RHtyze/giIlNZDdFPO4elRxOya2itk4WsCLsaCOyFz0+r7HkDzzxrpsyeyXpv8VsCg8zTlI8vhNUtYvwy7LiEqithVcuTe5gRig0vT1zuuAQmXiWjtqrwx9UEQXXuRVovt2UsWQLduBFbNlJYH0t+RJzA0FGr0uMAY30yAqc9tp9vA0JfPWIH1wFqJ7tMGPcvzdg2UKnXHs5v3NVPKgsX6tdF81Hxomr3TQTPynFPlaFyFB8QKBgQDWNo7AiqGkxfmVy7HYqG8vIhyjDZY8JMD0IvIXoZyyveMIVPaCGeeC7v5RLRKIE+J2BOyDDIPTxgBCu5VQusFGUWgjQZSnDR6JR43c6mvgUAmvwx5W+VXPcip3dprHACL9pQsg2Wjiune819j0dFB0VwKN/OjGJw6VAeSSbEHLBwKBgQDGJphl0Je6rPBqdfVRMphnwB8eKi7HkcZXo1YcqlN/M2IVEGhuv0e+NNQlxJZDexzcC4tUTYBd+NCzy6DEUz4ycqay7zujYPbUP8EO+Nx/trNfWco2mZlug+eZW+rOR3lPKTG6VpPtUhE6ml62AL33dGbOYIvZT+IHujJq2Qf3nwKBgQCHWvP6395h4qLhr1NSZqPSsYhM03IB0OuHmGlG21zLaMcDZcRZ0wqBpohWPNe/2mi3UEcuS4MlFrDleehQmaE00I2v8Wl/4P9RmUAfvpSpqYllYTJTnLtHGImS8QO+CO0TPu14NUhcM50jW3SAitqnmK9Jjux7AQTqzMZkazlrkwKBgQCEev9/ayRW2hNvimg3HpXJIClt+JQIOE2dAIataa+jpw4XuT2pddgYsqd4jOROP7y+3jUMazi9G4MmAqn9OQ6nmgIcNljwVf8RT4LbaMW72cI5qQXK1Y1A1437+fmWazEPHSKzS/lhPXJpdRaHpx1bmga2StSVuZQMyI+24l4yTwKBgGWuKoAHYq5lF8cw7+YWGKzT7UTxk3143u0+0drCTEi/gfiwowM71YVN6eitCvX0KcS1ne4KHD1oXyTOE21rxeb02D5rWSFhRFfWjZjgCVrVh0+J/fGFfg3zSHT4R7fM6coFYz/WARmTeVaGnNTzzU5Ig4zdcstWVVDFIk9QLWVu";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkXIKjik+woAAqQFHI35yUyUpboVF7d0qSHWZfBldPWpM0Tg+Ny8N43OsfyJ6RWLkwJf7oMFhOVu9tx/V32il9zNQDJ6FWtvXZL23lpxetK6eJn306TeuhRvV1C1hu6SLZQHVw38oJkpeGoTbpEDLlHQcK+9BqmrIEWBEQ/MQ+C/qOPn5uuoHE2as2eDEmXr27L0SrK2FPZGmQVt9GqcTndvHWNiYTWa+XNWprri24qcTGT4VAh+ylJ39M2I39AvjmKbn1H+EbFY1+hsSkO5mN/FgvAqHH/n1/cbljProsQarnR9KndZ1orpk1qIQ790Xn2yuVJ1fMqabuN/DgYOjPQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://4tjt3q.natappfree.cc/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://4tjt3q.natappfree.cc/return_url.jsp";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";

    private int m=3;


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

